DROP TABLE IF EXISTS jms_dwd.dwd_barscan_sign_dt ;
CREATE EXTERNAL TABLE jms_dwd.dwd_barscan_sign_dt (
billcode            string        comment  '运单编号' ,                     --nvarchar2(20)
scansitecode_later            string        comment  '扫描网点编号' ,                     --nvarchar2(20)
delivertime_later            timestamp        comment  '派送时间' ,                     --date
inputtime_later            timestamp        comment  '录入时间' ,                     --date
destsite_later            string        comment  '目的网点' ,                     --nvarchar2(30)
recepitsigned_later            string        comment  '货单已签' ,                     --nvarchar2(5)
send_deliver_usercode_later            string        comment  '收派员编号' ,                     --nvarchar2(20)
signuser_later            string        comment  '签收人' ,                     --nvarchar2(50)
deliveruser_later            string        comment  '派件员' ,                     --nvarchar2(30)
sendsite_later            string        comment  '寄件网点' ,                     --nvarchar2(30)
realweight_later            decimal(10, 2)        comment  '实际重量' ,                     --number(10,2)
uploadtime_later           timestamp        comment  '上传时间' ,                     --date

scansitecode_early            string        comment  '扫描网点编号' ,                     --nvarchar2(20)
delivertime_early            timestamp        comment  '派送时间' ,                     --date
inputtime_early            timestamp        comment  '录入时间' ,                     --date
destsite_early            string        comment  '目的网点' ,                     --nvarchar2(30)
recepitsigned_early            string        comment  '货单已签' ,                     --nvarchar2(5)
send_deliver_usercode_early            string        comment  '收派员编号' ,                     --nvarchar2(20)
signuser_early            string        comment  '签收人' ,                     --nvarchar2(50)
deliveruser_early            string        comment  '派件员' ,                     --nvarchar2(30)
sendsite_early            string        comment  '寄件网点' ,                     --nvarchar2(30)
realweight_early            decimal(10, 2)        comment  '实际重量' ,                     --number(10,2)
uploadtime_early           timestamp        comment  '上传时间'                      --date
)
    COMMENT '签收去重表'
    PARTITIONED BY (
         dimtype  STRING COMMENT '去重维度:billcode为运单维度去重;bill_scansite为运单加网点维度去重;',
         dt         STRING COMMENT '更新日期 (yyyy-MM-dd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dwd.db/external/dwd_barscan_sign_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_dwd.dwd_barscan_sign_dt;
